﻿@model GameCode.Models.Admin.AdvertiseModel
@{
    ViewBag.Title = "游戏特权 - 广告管理";
    Model.Caption = "广告管理";
    Model.NewLink = "/Admin/AdvertiseEdit";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@using (Html.BeginForm(new { act = "submit" }))
{
    var grid = new WebGrid(source: Model.List, rowsPerPage: 30);
    @grid.GetHtml(
        htmlAttributes: new { cellpadding = "0", cellspacing = "0" },
        headerStyle: "ui-li ui-li-divider ui-btn ui-bar-a ui-btn-hover-undefined ui-btn-up-undefined",
    columns: grid.Columns
        (
            grid.Column("Name", "名称"),
            grid.Column("ProjectName", "项目名称"),
            grid.Column("GameName", "游戏名称"),
            grid.Column(header: "图片", format: (item) => Html.Raw(string.Format("<img src='{0}' height=25 width=70/>", item.ImageLink == null ? "" : item.ImageLink)), canSort: false),
            grid.Column("DateTime", "发布日期"),
            grid.Column(header: "状态", format: (item) => Html.ActionLink(item.Effective ? "失效" : "生效", "AdvertiseEffective", new { id = item.Id }), canSort: false),
            grid.Column(header: "编辑",format: (item) => Html.ActionLink("编辑", "AdvertiseEdit", new { id = item.Id }), canSort: false),
            grid.Column(header: "删除", format: (item) => Html.ActionLink("删除", "AdvertiseDelete", new { id = item.Id }), canSort: false)
        )
    )
}